<?php
class BO_User{
	public $id;
	public $usrName;
	public $fullName;
	public $isAdmin;
	public $profile;
	private $functions = NULL;
	private $modules = NULL;
	public function getFunctions(){
		if(is_null($this->functions)){
			$this->functions = DA_User::getFuncionsByUser($this);
		}
		return $this->functions;
	}
	public function getModules() {
		if(is_null($this->modules)){
			if(is_null($this->functions)){
				$this->getFunctions();				
			}
			$result = array();	
			foreach ($this->functions as $functionName) {
				$name_parts = explode('_',$functionName);
				if(!in_array($name_parts[0],$result)){
					array_push($result,$name_parts[0]);
				}
			}		
			$this->modules = $result;		
		}
		return $this->modules;
	}
}
?>